import Vue from 'vue';
import VueRouter from 'vue-router';

import Home from '../page/Home/index.vue';

Vue.use(VueRouter);

const routes = [
	{
		path: '/',
		name: 'Home',
		component: Home,
		alias: '/home',
		meta: { title: '首页' },
	},
	{
		path: '/about',
		name: 'About',
		component: () => import('../page/About/index.vue'),
		meta: { title: '关于' },
	},
	{
		path: '/login',
		name: 'Login',
		component: () => import('../page/Login/index.vue'),
		meta: { title: '登录' },
	},
	{
		path: '/account',
		name: '/Account',
		component: () => import('../page/Account/index.vue'),
		meta: { title: '账户' },
	},
];

// router.beforeEach((to, from, next) => {});

const router = new VueRouter({
	routes,
	mode: 'history',
});

export default router;
